<template>
  <div class="items">
    <!-- <span style="color: red; font-size: 20px;font-weight: 700;">全部商品</span> -->
    <div class="top">
      <div class="t-checkbox">
        <input type="checkbox" name="" id="check-all" v-model="checked" @change="checkedAll" />
        <label for="check-all">全部</label>
      </div>
      <div class="t-goods">
        商品
      </div>
      <div class="t-props">
        &nbsp;
      </div>
      <div class="t-price">单价</div>
      <div class="t-quantity">数量</div>
      <div class="t-sum">小计</div>
      <div class="t-action">操作</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    chose: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      checked: false
    }
  },
  methods: {
    checkedAll() {
      this.$emit('seleteAll', this.checked)
    }
  },
  watch: {
    chose: function(val) {
      this.checked = val
    }
  }
}
</script>

<style lang="less" scoped>
.items {
  width: 988px;
  margin: auto;

  .top {
    user-select: none;
    font-size: 12px;
    background: #f3f3f3;
    height: 43px;
    line-height: 43px;
    color: #434343;
    .t-checkbox {
      float: left;
      width: 150px;
      margin-left: 10px;
    }
    .t-goods {
      float: left;
      width: 150px;
    }
    .t-props {
      float: left;
      width: 200px;
    }
    .t-price {
      float: left;
      width: 100px;
    }
    .t-quantity {
      float: left;
      width: 150px;
    }
    .t-sum {
      float: left;
      width: 100px;
    }
    .t-action {
      float: right;
      width: 120px;
    }
  }
}
label {
  cursor: pointer;
}
</style>
